package com.spring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {

    /**基于客户端的/hello请求返回一个 hello页面*/
    @RequestMapping("/hello")
    public String doHelloUI() {//这方式了解即可，在前后端分离架构下，这种方式用的少了
        System.out.println("===doHelloUI()===");
        return "hello";//viewname
        //prefix+hello+suffix=/templates/hello.html
    }

    /**基于客户端的/doSayHello请求返回一个字符串*/
    @ResponseBody
    @RequestMapping("/doSayHello")
    public String doSayHello() {
        return "hello spring mvc";
    }



}
